﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Lab1
{
    public class UserAnswer
    {
        public int Number { get; set; }
        ///<summary> for answer with variant</summary>
        public Guid AnswerVariantId { get; set; }
        ///<summary> for free answer</summary>
        public string FreeAnswer { get; set; }
        ///<summary> for free answer</summary>
        public Guid QuestionId { get; set; }
        public Question Question
        {
            get
            {
                QuestionService qService = new QuestionService();
                return (FreeAnswer!=null)?qService.getById(QuestionId):AnswerVariant.QuestionParent;
            }
        }
        public AnswerVariant AnswerVariant
        {
            get
            {
                AnswerService aService = new AnswerService();
                return aService.getById(AnswerVariantId);
            }
        }
    }
}
